package com.xiashitech.agent.proxy.hutool;

import com.xiashitech.agent.cache.classloader.ClassLoaderCache;
import com.xiashitech.agent.config.StartConfig;

import java.util.Map;

public class MapUtil {

    private static String className = "cn.hutool.core.map.MapUtil";

    public static String getStr(Map<?, ?> map, Object key) {
        try {
            Class mapUtilClass = ClassLoaderCache.getLaunchClassLoader().loadClass(className);
            return (String)mapUtilClass.getMethod("getStr",Map.class,Object.class).invoke(null,map,key);
        } catch (Throwable e) {
            StartConfig.throwableStackPrinter(e);
        }
        return null;
    }
}
